<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .father {
        padding: 40px;
        width: 400px;
        height: 400px;
        box-sizing: border-box;
        background-color: pink;
      }
      .son {
        width: 200px;
        height: 200px;
        background-color: lime;
      }
    </style>
  </head>
  <body>
    <!-- 1. 先准备一个容器 -->
    <div id="app">
      <a href="https://www.baidu.com" @click.prevent="fn">百度一下</a>
      <div class="father" @click="fn1">
        <div class="son" @click.stop="fn2"></div>
      </div>
    </div>
    <!-- 2. 引框架 -->
    <script src="./vue.js"></script>
    <script>
      // 3.初始化vue实例对象
      const vm = new Vue({
        el: "#app",
        data: {},
        methods: {
          fn(e) {
            // e.preventDefault();
          },
          fn1() {
            console.log("father");
          },
          fn2(e) {
            // e.stopPropagation();
            console.log("son");
          },
        },
      });
    </script>
  </body>
</html>
<!-- 
修饰符有三种
1. 事件修饰符 prevent阻止默认行为 stop阻止冒泡
2. 按键修饰符 enter 
3. v-model修饰符 number trim lazy  -->
